package cn.elead.it.sso.system.service.impl;

import org.springframework.stereotype.Service;

import com.gitee.elead.mybatisplus.service.BaseServiceImpl;

import cn.elead.it.sso.system.dao.IClientDao;
import cn.elead.it.sso.system.model.Client;
import cn.elead.it.sso.system.service.IClientService;
import cn.hutool.core.util.StrUtil;

/**
 * <p>
 * 单点客户端服务类
 * </p>
 *
 * @author luopeng
 */
@Service
public class ClientService extends BaseServiceImpl<IClientDao, Client> implements IClientService {

	/**
	 * 根据客户端id获取客户端信息
	 * 
	 * @param clientId
	 * @return
	 */
	@Override
	public Client findByClientId(String clientId) {
		if(StrUtil.isBlank(clientId)) {
			return null;
		}
		return query().eq(Client::getClientId, clientId).getOne();
	}

}
